<div class="comment_form">
<form id="article_comment" action="<?php echo $this->getUrl(array('id'=>Kd_Web::getVariables()->getData('comment_article_id')),'commentFormPost','comment')?>" method="post">
             <?php

            $name = Kd_Web::getIdentity()->getName();
            if(!$name):
        ?>
        <ul>
              <label>姓 名: </label>
              <input type="text" id="name" name="name" maxlength="30" value=""/>
              <span>[<a id="Layer-User-Login" href="javascript:void(0);">登陆</a>
                  <a id="Layer-User-Reg" href="javascript:void(0);">注册</a>]</span>
	</ul>
        <?php endif;?>
        <ul><label>评论回复: </label><textarea id="detail" name="detail" cols="80" rows="8" ></textarea></ul>
        <ul><label>验 证 码: </label><input type="text" id="validatecode" name="validatecode" maxlength="6"/></ul>
        <ul><label>&nbsp; </label><?php echo $this->validateCodeImage()?></ul>
        <ul><label>&nbsp;</label><input type="hidden" name="check" value="yes" /><button class="button" type="submit">提交</button></ul>
</form>
</div>

<script language="javascript" type="text/javascript">
$(function(){
    $('#article_comment').validate({
        rules:{
            detail:{required:true,minlength:5,maxlength:150}
        },
        messages:{
            detail:{required:"评论内容不能为空",minlength:'评论不少于5个字',maxlength:'评论不能多于150个字'}
        }
    });

    $("#Layer-User-Login").attr("href","javascript:void(0)").click(function(){
            $.ajax({
                    url:'/proxy/account/loginEmpty',
                    datatype:'html',
                    success:function(req){
                        var ret = new LayerMode();
                        ret.speed = "fast";	//弹出和关闭耗时 默认 400ms
                        ret.bgLayer = true;	//false 关闭背景层 默认 true
                        ret.bgLayerEvent = true;	//默认背景层快速关闭事件 true 开启 默认 false
                        ret.txtTitle = '登录窗口';
//                        ret.thead();
                        ret.tbody(req);
                        ret.open();
                        ret.range = true; //拖动范围 true(可见区域) 默认 false(不限)
                        ret.drag();		//启用拖动
                    }
          })
         
    });

    $("#Layer-User-Reg").attr("href","javascript:void(0)").click(function(){
            $.ajax({
                    url:'/proxy/account/registerEmpty',
                    datatype:'html',
                    success:function(req){
                        var ret = new LayerMode();
                        ret.speed = "fast";	//弹出和关闭耗时 默认 400ms
                        ret.bgLayer = true;	//false 关闭背景层 默认 true
                        ret.bgLayerEvent = true;	//默认背景层快速关闭事件 true 开启 默认 false
                        ret.txtTitle = '登录窗口';
                        ret.thead();
                        ret.tbody(req);
                        ret.open();
                        ret.range = true; //拖动范围 true(可见区域) 默认 false(不限)
                        ret.drag();		//启用拖动
                }
            })
    })
});
</script>